/*
 * @Author: zhangyun
 * @Date: 2021-04-20 15:29:57
 * @LastEditors: zhangyun
 * @LastEditTime: 2021-04-26 16:45:08
 * @Desc: 
 */
import { defineConfig } from 'vite'
import path from 'path'

import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
      "@components": path.resolve(__dirname, "src/components"),
      "@utils": path.resolve(__dirname, "src/utils"),
      "@assets": path.resolve(__dirname, "src/assets"),
      "@styles": path.resolve(__dirname, "src/styles"),
      "@pages": path.resolve(__dirname, "src/pages"),
    }
  },
  server: {
    port: 8088,
    cors: true,
    proxy: {
      '/api': {
        target: 'http://192.168.0.32:3030/',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
